
use main

******************************************************************************************************
********************************************FIGURES****************************************************
*******************************************************************************************************

**********Figure 1****************

preserve
 tsset week_start_day

twoway (tsline major , ///
lwidth(thin) lcolor(black) ylab( ,angle(horizontal)  labsize(vsmall)) ytitle("") xtitle("") ///
title("Weekly count of major protest (Feb 21st, 2011-Jun 30th, 2017)",size(vsmall)) graphregion(color(white))), ///
xscale(r(18659 21549)) xtick(18659(35)21549) xlab("" ,angle(75) labsize(tiny))  ylab(,angle(horizontal) labsize(tiny)) ///
saving(protest1,replace) fysize(20) graphregion(margin(none)) nodraw 


twoway (tsline protest2, ///
lwidth(thin) lcolor(black) ylab( ,angle(horizontal)  labsize(vsmall)) ytitle("") xtitle("") ///
title("Weekly count of protest2(Feb 21st, 2011-Dec 30th, 2018)",size(vsmall)) graphregion(color(white))), ///
xscale(r(18659 21549)) xtick(18659(35)21549) xlab("" ,angle(75) labsize(tiny))  ylab(,angle(horizontal) labsize(tiny)) ///
saving(protest2,replace) fysize(20) graphregion(margin(none)) nodraw 

twoway (tsline GDELT_protest, ///
lwidth(thin) lcolor(black) ylab( ,angle(horizontal)  labsize(vsmall)) ytitle("") xtitle("") ///
title("Weekly number of GDELT protest report (Feb 21st, 2011-Dec 30th, 2018)",size(vsmall)) graphregion(color(white))), ///
xscale(r(18659 21549)) xtick(18659(35)21549) xlab("" ,angle(75) labsize(tiny))  ylab(,angle(horizontal) labsize(tiny)) ///
saving(protest3,replace) fysize(20) graphregion(margin(none)) nodraw 



twoway(tsline nontrd_report,  ///
lwidth(thin) lcolor(black)  ylab( ,angle(horizontal) labsize(vsmall)) ytitle("") xtitle("")  ///
 title("Weekly count of weigted non-trade report",size(vsmall)) graphregion(color(white)) ), ///
xscale(r(18659 21549)) xtick(18659(35)21549) xlab("" ,angle(75) labsize(tiny)) ///
saving(nontrd,replace) fysize(20) graphregion(margin(none)) nodraw


twoway(tsline cflct_report, ///
lwidth(thin) lcolor(black)  ylab( ,angle(horizontal) labsize(vsmall)) ytitle("") xtitle("")  ///
title("Weekly count of weigted conflict report",size(vsmall))  graphregion(color(white)) ), ///
xscale(r(18659 21549)) xtick(18659(35)21549) xlab("",angle(75) labsize(tiny)) ///
saving(cflct,replace) fysize(20) graphregion(margin(none)) nodraw
 
twoway(tsline all_report, ///
lwidth(thin) lcolor(black)  ylab( ,angle(horizontal) labsize(vsmall)) ytitle("")  xtitle("") ///
 title("Weekly count of weigted all diversionary Report",size(vsmall))  graphregion(color(white)) ), ///
xscale(r(18659 21549)) xtick(18659(35)21549) xlab(18659(70)21549 ,angle(65) labsize(tiny)) ///
saving(all,replace) fysize(26) graphregion(margin(none)) nodraw

graph combine protest1.gph protest2.gph protest3.gph nontrd.gph cflct.gph all.gph  , ///
col(1) scheme(s2mono) graphregion(color(white)) ///
xsize(20) ysize(20)

restore






**********************Figure 2***********************************************************

preserve
tsset week
quietly poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report major intl_conference nati_conference   ww2_memo  lstock_pr gdpgr_yr icb misery_index
quietly margins,  at(major =(0(2)31)) force  
marginsplot, saving(file1, replace) nodraw  ///
 recast(line) recastci(rarea) ciopt(color(%20))  graphregion(color(white)) ytitle("") xlabel(0(4)31) ylabel(6(1)11) ///
 xtitle("Weekly Count of Major Protest",size(small)) title("Predicted Non-trade Conflict Report", size(small)) 
 
 
quietly  poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report major intl_conference nati_conference    ww2_memo  lstock_pr  gdpgr_yr icb misery_index
quietly margins,   at(major=(0(2)31)) force  
marginsplot, saving(file2, replace) nodraw ///
recast(line) recastci(rarea) ciopt(color(%20))  graphregion(color(white)) ytitle("") xlabel(0(4)31) ylabel(6(1)11)  ///
 xtitle("Weekly Count of Major Protest",size(small)) title("Predicted Conflict Report", size(small)) 
 
quietly poisson all_report l.all_report l2.all_report   l4.all_report major intl_conference nati_conference    ww2_memo  lstock_pr   gdpgr_yr icb misery_index
quietly margins,  at(major=(0(2)31)) force  
marginsplot, saving(file3, replace) nodraw ///
recast(line) recastci(rarea) ciopt(color(%20))  graphregion(color(white)) ytitle("") xlabel(0(4)31) ylabel(7(1)11)  ///
xtitle("Weekly Count of Major Protest",size(small)) title("Predicted All Diversionary Report", size(small)) 


quietly poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report  protest2 intl_conference nati_conference   ww2_memo  lstock_pr gdpgr_yr  misery_index
quietly margins,  at(protest2=(0(3)35)) force  
marginsplot, saving(file4, replace) nodraw  ///
recast(line) recastci(rarea) ciopt(color(%20))  graphregion(color(white)) ytitle("") xlabel(0(5)35) ylabel(6(1)11) ///
 xtitle("Weekly Count of Protest2",size(small)) title("Predicted  Non-trade Conflict Report", size(small)) 


quietly  poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report protest2 intl_conference nati_conference    ww2_memo  lstock_pr  gdpgr_yr  misery_index
quietly margins,   at(protest2=(0(3)35)) force  
marginsplot, saving(file5, replace) nodraw ///
recast(line) recastci(rarea) ciopt(color(%20))  graphregion(color(white)) ytitle("") xlabel(0(5)35) ylabel(7(1)11) ///
 xtitle("Weekly Count of Protest2",size(small)) title("Predicted Conflict Report Count", size(small)) 
 
quietly poisson all_report l.all_report l2.all_report   l4.all_report  protest2 intl_conference nati_conference    ww2_memo  lstock_pr   gdpgr_yr  misery_index
quietly margins,  at(protest2=(0(3)35)) force  
marginsplot, saving(file6, replace) nodraw ///
recast(line) recastci(rarea) ciopt(color(%20))  graphregion(color(white)) ytitle("") xlabel(0(5)35) ylabel(8(1)12) ///
xtitle("Weekly Count of Protest2",size(small)) title("Predicted All Diversionary Report", size(small)) 

quietly poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report   GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr gdpgr_yr  misery_index
quietly margins,  at(GDELT_protest=(0(20)500)) force  
marginsplot, saving(file7, replace) nodraw  ///
recast(line) recastci(rarea) ciopt(color(%20))  graphregion(color(white)) ytitle("") xlabel(0(50)500) ylabel(5(1)11) ///
 xtitle("Weekly Count of GDELT Protest",size(small)) title("Predicted Weighted Non-trade Conflict Report Count", size(small)) 


quietly  poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report GDELT_protest intl_conference nati_conference    ww2_memo  lstock_pr  gdpgr_yr  misery_index
quietly margins,   at(GDELT_protest=(0(20)500)) force  
marginsplot, saving(file8, replace) nodraw ///
recast(line) recastci(rarea) ciopt(color(%20))  graphregion(color(white)) ytitle("") xlabel(0(50)500)  ylabel(6(1)13) ///
 xtitle("Weekly Count of GDELT Protest",size(small)) title("Predicted  Conflict Report", size(small)) 
 
quietly poisson all_report l.all_report l2.all_report   l4.all_report  GDELT_protest intl_conference nati_conference    ww2_memo  lstock_pr   gdpgr_yr  misery_index
quietly margins,  at(GDELT_protest=(0(20)500)) force  
marginsplot, saving(file9, replace) nodraw ///
recast(line) recastci(rarea) ciopt(color(%20))  graphregion(color(white)) ytitle("") xlabel(0(50)500) ylabel(7(1)13) ///
xtitle("Weekly Count of GDELT Protest",size(small)) title("Predicted All Diversionary Report", size(small)) 




graph combine file1.gph file2.gph file3.gph file4.gph file5.gph file6.gph file7.gph file8.gph file9.gph , ///
col(3) scheme(s2mono) graphregion(color(white)) ///
xsize(16) ysize(20)

restore



********************************Appendix C*******************************************************
ac nontrd_report,saving(file1, replace) nodraw  
pac nontrd_report,saving(file2, replace) nodraw 

ac cflct_report,saving(file3, replace) nodraw    
pac cflct_report,saving(file4, replace) nodraw    

ac all_report,saving(file5, replace) nodraw  
pac all_report,saving(file6, replace) nodraw 

graph combine file1.gph file2.gph file3.gph file4.gph file5.gph file6.gph, ///
col(2) scheme(s2mono) graphregion(color(white)) ///
xsize(16) ysize(20)




******************************************************************************************************
********************************************TABLES****************************************************
*******************************************************************************************************

****************************************************************************Appendix A*************
sum nontrd_report cflct_report all_report  major protest2 GDELT_protest gdpgr_yr intl_ nati_ ww2_ icb misery_ cpi constrct wt_nontrd_report wt_cflct_report wt_all_report rm_diver mmd_pr



*****************************************************




********************************************Table #1**************************************************

varsoc nontrd_report major intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  nontrd_report major  intl_conference nati_conference   ww2_memo  lstock_pr icb,lags(1/1)
varsoc cflct_report major intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  cflct_report major  intl_conference nati_conference   ww2_memo  lstock_pr icb,lags(1/1)
varsoc all_report major intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  all_report major intl_conference nati_conference   ww2_memo  lstock_pr icb,lags(1/1)



preserve
eststo clear
tsset week

quietly eststo: poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report major intl_conference    nati_conference   ww2_memo  lstock_pr gdpgr_yr  icb  misery_index
quietly eststo: nbreg nontrd_report l.nontrd_report  l2.nontrd_report    l4.nontrd_report major intl_conference  nati_conference     ww2_memo  lstock_pr   gdpgr_yr  icb  misery_index

quietly eststo: poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report major intl_conference   nati_conference    ww2_memo  lstock_pr  gdpgr_yr  icb  misery_index
quietly eststo: nbreg cflct_report l.cflct_report l2.cflct_report   l4.cflct_report major intl_conference  nati_conference   ww2_memo  lstock_pr  gdpgr_yr  icb  misery_index

quietly eststo:poisson all_report l.all_report l2.all_report   l4.all_report  major intl_conference nati_conference    ww2_memo lstock_pr   gdpgr_yr  icb  misery_index
quietly eststo:nbreg all_report l.all_report l2.all_report  l4.all_report major intl_conference  nati_conference    ww2_memo  lstock_pr  gdpgr_yr  icb misery_index

esttab using table_1.rtf, replace mtitle ( "poisson_nontrd_" "nbreg_poisson_nontrd" "poisson_conflict" "nbreg_conflict" "poisson_all" "nbreg_all") starlevels( * 0.10 ** 0.05 *** 0.010)
restore






********************************************Appendix D1 and Part of Table 2**************************************************

varsoc nontrd_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr  
var  nontrd_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr  ,lags(1/1)
varsoc cflct_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr 
var  cflct_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr  ,lags(1/1)
varsoc all_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr  
var  all_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr  ,lags(1/1)


preserve
eststo clear
tsset week

 eststo: poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report protest2  intl_conference  nati_conference   ww2_memo  lstock_pr gdpgr_yr   misery_index
 eststo: nbreg nontrd_report l.nontrd_report  l2.nontrd_report    l4.nontrd_report protest2 intl_conference nati_conference     ww2_memo  lstock_pr   gdpgr_yr   misery_index

 eststo: poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report protest2 intl_conference nati_conference    ww2_memo  lstock_pr  gdpgr_yr   misery_index
 eststo: nbreg cflct_report l.cflct_report l2.cflct_report   l4.cflct_report protest2 intl_conference  nati_conference   ww2_memo  lstock_pr  gdpgr_yr   misery_index

 eststo:poisson all_report l.all_report l2.all_report   l4.all_report  protest2 intl_conference nati_conference    ww2_memo  lstock_pr  gdpgr_yr   misery_index
 eststo:nbreg all_report l.all_report l2.all_report  l4.all_report protest2 intl_conference  nati_conference    ww2_memo  lstock_pr  gdpgr_yr   misery_index
 
esttab using appendix_d1.rtf, replace mtitle ( "poisson_nontrd_" "nbreg_poisson_nontrd" "poisson_conflict" "nbreg_conflict" "poisson_all" "nbreg_all") starlevels( * 0.10 ** 0.05 *** 0.010)
restore





*******************************Appendix D2 and Part of Table 2******************************************************************************************

varsoc nontrd_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr 
var  nontrd_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr ,lags(1/2)
varsoc cflct_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr 
var  cflct_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr ,lags(1/2)
varsoc all_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr
var  all_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr ,lags(1/2)

preserve
eststo clear
tsset week

eststo: poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report GDELT_protest intl_conference  nati_conference   ww2_memo lstock_pr gdpgr_yr  misery_index
eststo: nbreg nontrd_report l.nontrd_report  l2.nontrd_report    l4.nontrd_report GDELT_protest intl_conference  nati_conference     ww2_memo  lstock_pr   gdpgr_yr misery_index

 eststo: poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report GDELT_protest intl_conference  nati_conference    ww2_memo  lstock_pr gdpgr_yr misery_index
eststo: nbreg cflct_report l.cflct_report l2.cflct_report   l4.cflct_report GDELT_protest intl_conference  nati_conference   ww2_memo  lstock_pr gdpgr_yr misery_index

eststo:poisson all_report l.all_report l2.all_report   l4.all_report GDELT_protest intl_conference nati_conference    ww2_memo  lstock_pr   gdpgr_yr misery_index
 eststo:nbreg all_report l.all_report l2.all_report  l4.all_report GDELT_protest intl_conference  nati_conference    ww2_memo  lstock_pr  gdpgr_yr misery_index

esttab using appendix_d2.rtf, replace mtitle ( "poisson_nontrd_" "nbreg_poisson_nontrd" "poisson_conflict" "nbreg_conflict" "poisson_all" "nbreg_all") starlevels( * 0.10 ** 0.05 *** 0.010)
restore


****************************************************Appendix E and Table 3*****************************************************
preserve
replace major=0 if major==.
eststo clear
 eststo: ivpoisson gmm nontrd_report  intl_conference  nati_conference ww2_memo  (major= constrct cpi)
 ivreg2 nontrd_report  intl_conference  nati_conference ww2_memo  (major= constrct cpi)
 eststo: ivpoisson gmm cflct_report  intl_conference  nati_conference ww2_memo (major= constrct cpi)
 ivreg2 cflct_report  intl_conference  nati_conference ww2_memo (major= constrct cpi)
eststo: ivpoisson gmm all_report  intl_conference  nati_conference ww2_memo (major= constrct cpi)
ivreg2  all_report  intl_conference  nati_conference ww2_memo (major= constrct cpi)
 eststo: ivpoisson gmm nontrd_report  intl_conference  nati_conference ww2_memo (protest2= constrct cpi)
ivreg2 nontrd_report  intl_conference  nati_conference ww2_memo (protest2= constrct cpi)
 eststo: ivpoisson gmm cflct_report  intl_conference  nati_conference ww2_memo (protest2= constrct cpi)
 ivreg2 cflct_report  intl_conference  nati_conference ww2_memo (protest2= constrct cpi)
eststo: ivpoisson gmm all_report  intl_conference  nati_conference ww2_memo (protest2= constrct cpi)
ivreg2 all_report  intl_conference  nati_conference ww2_memo (protest2= constrct cpi)
 eststo: ivpoisson gmm nontrd_report  intl_conference  nati_conference ww2_memo (GDELT_protest= constrct cpi)
ivreg2 nontrd_report  intl_conference  nati_conference ww2_memo (GDELT_protest= constrct cpi)
eststo: ivpoisson gmm cflct_report  intl_conference  nati_conference ww2_memo (GDELT_protest= constrct cpi)
ivreg2 cflct_report  intl_conference  nati_conference ww2_memo (GDELT_protest= constrct cpi)
 eststo: ivpoisson gmm all_report  intl_conference  nati_conference ww2_memo (GDELT_protest= constrct cpi)
 ivreg2 all_report  intl_conference  nati_conference ww2_memo (GDELT_protest= constrct cpi)

esttab using table_3.rtf, replace mtitle ( "nontrd_conflict_coverage"  "conflict_coverage"  "all_coverage") starlevels( * 0.10 ** 0.05 *** 0.010)
restore



***************************************Appendices F1_F3 and Table 4************************************************************************************


***********Appendix F1*************
varsoc wt_nontrd_report major  intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  wt_nontrd_report major intl_conference nati_conference   ww2_memo  lstock_pr icb ,lags(1/1)
varsoc wt_cflct_report major  intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  wt_cflct_report major  intl_conference nati_conference   ww2_memo  lstock_pr icb ,lags(1/1)
varsoc wt_all_report major  intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  wt_all_report major  intl_conference nati_conference   ww2_memo  lstock_pr icb ,lags(1/1)


preserve
eststo clear
tsset week

eststo: poisson wt_nontrd_report l.wt_nontrd_report  l2.wt_nontrd_report  l4.wt_nontrd_report major intl_conference  nati_conference    ww2_memo lstock_pr gdpgr_yr  icb misery_index
eststo: nbreg wt_nontrd_report l.wt_nontrd_report  l2.wt_nontrd_report   l4.wt_nontrd_report major intl_conference nati_conference    ww2_memo lstock_pr gdpgr_yr  icb misery_index

eststo: poisson wt_cflct_report l.wt_cflct_report  l2.wt_cflct_report  l4.wt_cflct_report major intl_conference  nati_conference     ww2_memo lstock_pr gdpgr_yr  icb misery_index
eststo: nbreg wt_cflct_report l.wt_cflct_report  l2.wt_cflct_report  l4.wt_cflct_report major intl_conference nati_conference     ww2_memo  lstock_pr gdpgr_yr  icb misery_index

eststo:poisson wt_all_report l.wt_all_report l2.wt_all_report l4.wt_all_report major intl_conference  nati_conference    ww2_memo  lstock_pr gdpgr_yr  l.icb misery_index
eststo:nbreg wt_all_report l.wt_all_report l2.wt_all_report  l4.wt_all_report major intl_conference nati_conference     ww2_memo  lstock_pr gdpgr_yr  l.icb misery_index

esttab using appendix_f1.rtf, replace mtitle ( "poisson_nontrd_" "nbreg_poisson_nontrd" "poisson_conflict" "nbreg_conflict" "poisson_all" "nbreg_all") starlevels( * 0.10 ** 0.05 *** 0.010)
restore

***********Appendix F2*************



varsoc wt_nontrd_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  wt_nontrd_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr icb ,lags(1/1)
varsoc wt_cflct_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  wt_cflct_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr icb ,lags(1/1)
varsoc wt_all_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  wt_all_report protest2 intl_conference nati_conference   ww2_memo  lstock_pr icb,lags(1/1)




preserve
eststo clear
tsset week

 eststo: poisson wt_nontrd_report l.wt_nontrd_report  l2.wt_nontrd_report  l4.wt_nontrd_report protest2 intl_conference nati_conference    ww2_memo lstock_pr gdpgr_yr misery_index
 eststo: nbreg wt_nontrd_report l.wt_nontrd_report  l2.wt_nontrd_report   l4.wt_nontrd_report protest2 intl_conference nati_conference    ww2_memo lstock_pr gdpgr_yr  misery_index

 eststo: poisson wt_cflct_report l.wt_cflct_report  l2.wt_cflct_report  l4.wt_cflct_report protest2 intl_conference nati_conference    ww2_memo  lstock_pr gdpgr_yr misery_index
 eststo: nbreg wt_cflct_report l.wt_cflct_report  l2.wt_cflct_report  l4.wt_cflct_report protest2 intl_conference nati_conference    ww2_memo  lstock_pr gdpgr_yr misery_index

eststo:poisson wt_all_report l.wt_all_report l2.wt_all_report l4.wt_all_report  protest2 intl_conference nati_conference    ww2_memo  lstock_pr gdpgr_yr  
 eststo:nbreg wt_all_report l.wt_all_report l2.wt_all_report  l4.wt_all_report   protest2 intl_conference nati_conference      ww2_memo  lstock_pr gdpgr_yr misery_index

esttab using appendix_f2.rtf, replace mtitle ( "poisson_nontrd_" "nbreg_poisson_nontrd" "poisson_conflict" "nbreg_conflict" "poisson_all" "nbreg_all") starlevels( * 0.10 ** 0.05 *** 0.010)
restore



***********Appendix F3*************
varsoc wt_nontrd_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  wt_nontrd_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr icb ,lags(1/1)
varsoc wt_cflct_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  wt_cflct_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr icb ,lags(1/1)
varsoc wt_all_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  wt_all_report GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr icb ,lags(1/1)

preserve
eststo clear
tsset week

eststo: poisson wt_nontrd_report l.wt_nontrd_report  l2.wt_nontrd_report  l4.wt_nontrd_report GDELT_protest intl_conference  nati_conference   ww2_memo lstock_pr gdpgr_yr  misery_index
eststo: nbreg wt_nontrd_report l.wt_nontrd_report  l2.wt_nontrd_report  l4.wt_nontrd_report  GDELT_protest intl_conference  nati_conference   ww2_memo lstock_pr gdpgr_yr misery_index

eststo: poisson wt_cflct_report l.wt_cflct_report  l2.wt_cflct_report  l4.wt_cflct_report GDELT_protest  intl_conference   nati_conference    ww2_memo  lstock_pr gdpgr_yr  misery_index
 eststo: nbreg wt_cflct_report l.wt_cflct_report  l2.wt_cflct_report  l4.wt_cflct_report GDELT_protest intl_conference  nati_conference    ww2_memo lstock_pr gdpgr_yr  misery_index

eststo:poisson wt_all_report l.wt_all_report l2.wt_all_report l4.wt_all_report  GDELT_protest intl_conference   nati_conference    ww2_memo  lstock_pr gdpgr_yr misery_index
eststo:nbreg wt_all_report l.wt_all_report l2.wt_all_report  l4.wt_all_report   GDELT_protest intl_conference   nati_conference     ww2_memo  lstock_pr gdpgr_yr  misery_index

esttab using appendix_f3.rtf, replace mtitle ( "poisson_nontrd_" "nbreg_poisson_nontrd" "poisson_conflict" "nbreg_conflict" "poisson_all" "nbreg_all") starlevels( * 0.10 ** 0.05 *** 0.010)
restore






**********************************************Appendix G and Table 5************************************************************************
varsoc rm_diver  major  intl_conference nati_conference   ww2_memo  lstock_pr icb 
var  rm_diver  major intl_conference nati_conference   ww2_memo  lstock_pr icb ,lags(1/1)
varsoc rm_diver  protest2 intl_conference nati_conference   ww2_memo  lstock_pr
var  rm_diver  protest2 intl_conference nati_conference   ww2_memo  lstock_pr ,lags(1/1)
varsoc rm_diver  GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr 
var  rm_diver  GDELT_protest intl_conference nati_conference   ww2_memo  lstock_pr ,lags(1/1)


preserve
eststo clear
tsset week

quietly eststo: poisson rm_diver l.rm_diver l2.rm_diver    l4.rm_diver  major intl_conference nati_conference   ww2_memo  l.lstock_pr gdpgr_yr icb  misery_index
quietly eststo: nbreg rm_diver l.rm_diver  l2.rm_diver   l4.rm_diver  major intl_conference nati_conference     ww2_memo  l.lstock_pr   gdpgr_yr  icb  misery_index
quietly eststo: poisson rm_diver l.rm_diver l2.rm_diver    l4.rm_diver  protest2 intl_conference nati_conference   ww2_memo  l.lstock_pr gdpgr_yr   misery_index
quietly eststo: nbreg rm_diver l.rm_diver  l2.rm_diver   l4.rm_diver  protest2 intl_conference nati_conference     ww2_memo  l.lstock_pr   gdpgr_yr  misery_index
quietly eststo: poisson rm_diver l.rm_diver l2.rm_diver    l4.rm_diver  GDELT_protest intl_conference nati_conference   ww2_memo  l.lstock_pr gdpgr_yr   misery_index
quietly eststo: nbreg rm_diver l.rm_diver  l2.rm_diver   l4.rm_diver  GDELT_protest intl_conference nati_conference     ww2_memo  l.lstock_pr   gdpgr_yr   misery_index

esttab using table_5.rtf, replace mtitle ( "poisson_nontrd_" "nbreg_poisson_nontrd" "poisson_conflict" "nbreg_conflict" "poisson_all" "nbreg_all") starlevels( * 0.10 ** 0.05 *** 0.010)
restore



*****************************************************Appendix H and Table 6***************************************************************


varsoc nontrd_report mmd_protest intl_conference nati_conference   ww2_memo  lstock_pr 
var  nontrd_report mmd_protest  intl_conference nati_conference   ww2_memo  lstock_pr ,lags(1/1)
varsoc cflct_report mmd_protest  intl_conference nati_conference   ww2_memo  lstock_pr 
var  cflct_report mmd_protest  intl_conference nati_conference   ww2_memo  lstock_pr , lags(1/1)
varsoc all_report mmd_protest  intl_conference nati_conference   ww2_memo  lstock_pr 
var  all_report mmd_protest  intl_conference nati_conference   ww2_memo  lstock_pr  ,lags(1/1)



preserve
eststo clear
tsset week

eststo: poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report  mmd_protest  intl_conference  nati_conference   ww2_memo lstock_pr gdpgr_yr    misery_index
eststo: nbreg nontrd_report l.nontrd_report  l2.nontrd_report    l4.nontrd_report mmd_protest intl_conference  nati_conference     ww2_memo  lstock_pr   gdpgr_yr   misery_index

 eststo: poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report mmd_protest  intl_conference  nati_conference    ww2_memo  lstock_pr gdpgr_yr    misery_index
eststo: nbreg cflct_report l.cflct_report l2.cflct_report   l4.cflct_report mmd_protest  intl_conference  nati_conference   ww2_memo  lstock_pr gdpgr_yr    misery_index

eststo:poisson all_report l.all_report l2.all_report   l4.all_report mmd_protest  intl_conference nati_conference    ww2_memo  lstock_pr   gdpgr_yr   misery_index
 eststo:nbreg all_report l.all_report l2.all_report  l4.all_report mmd_protest  intl_conference  nati_conference    ww2_memo  lstock_pr  gdpgr_yr   misery_index

esttab using table_6.rtf, replace mtitle ( "poisson_nontrd_" "nbreg_poisson_nontrd" "poisson_conflict" "nbreg_conflict" "poisson_all" "nbreg_all") starlevels( * 0.10 ** 0.05 *** 0.010)
restore


*************************************************************Appendix K************************************************************
preserve

qui arima major, arima(2,0,1)
qui predict wn_major,resi


qui arima protest2, arima(2,0,1)
qui predict wn_protest2,resi

qui arima GDELT_protest , arima(3,0,1)
qui predict wn_GDELT_protest ,resi

qui arima mmd_protest , arima(3,0,1)
qui predict wn_mmd_protest ,resi

qui arima intl_conference, arima(1,0,0)
qui predict wn_intl_conference,resi

qui arima nati_conference, arima(3,0,0)
qui predict wn_nati_conference,resi

qui arima lstock_pr, arima(1,1,0)
qui predict wn_lstock_pr, resi

qui arima gdpgr_yr, arima(1,0,0)
qui predict wn_gdpgr_yr, resi

qui arima ww2,arima(1,0,0)
qui predict wn_ww2_memo,resi

qui arima icb, arima(2,0,1)
qui predict wn_icb,resi

quietly arima nontrd_report,arima(2,0,1)
predict wn_nontrd_report,resid

quietly arima cflct_report,arima(2,0,1)
predict wn_cflct_report,resid 

quietly arima all_report,arima(2,0,1)
predict wn_all_report, resid 

quietly arima misery_index,arima(1,0,0)
predict wn_misery, resid 

eststo clear
quietly eststo: regress wn_nontrd_report  wn_major wn_intl_conference wn_nati_conference  wn_ww2_memo  wn_lstock_pr wn_gdpgr_yr wn_icb wn_misery
quietly eststo: regress wn_nontrd_report  wn_protest2 wn_intl_conference wn_nati_conference  wn_ww2_memo  wn_lstock_pr wn_gdpgr_yr  wn_misery
quietly eststo: regress wn_nontrd_report  wn_GDELT_protest wn_intl_conference wn_nati_conference  wn_ww2_memo  wn_lstock_pr wn_gdpgr_yr wn_misery
quietly eststo: regress wn_cflct_report wn_major wn_intl_conference wn_nati_conference  wn_ww2_memo  wn_lstock_pr wn_gdpgr_yr wn_icb wn_misery
quietly eststo: regress wn_cflct_report wn_protest2 wn_intl_conference wn_nati_conference  wn_ww2_memo  wn_lstock_pr wn_gdpgr_yr  wn_misery
quietly eststo: regress wn_cflct_report wn_GDELT_protest wn_intl_conference wn_nati_conference  wn_ww2_memo  wn_lstock_pr wn_gdpgr_yr  wn_misery
quietly eststo: regress wn_all_report wn_major wn_intl_conference wn_nati_conference  wn_ww2_memo  wn_lstock_pr wn_gdpgr_yr wn_icb wn_misery
quietly eststo: regress wn_all_report wn_protest2 wn_intl_conference wn_nati_conference  wn_ww2_memo  wn_lstock_pr wn_gdpgr_yr  wn_misery
quietly eststo: regress wn_all_report wn_GDELT_protest wn_intl_conference wn_nati_conference  wn_ww2_memo  wn_lstock_pr wn_gdpgr_yr  wn_misery


esttab using appendix_k.rtf, replace mtitle ( "nontrd"  "nontrd" "nontrd" "conflict" "conflict"  "conflict"   "all"  "all" "all") starlevels( * 0.10 ** 0.05 *** 0.010)

restore



*****************************************************************Appendix I*******************************************
preserve
eststo clear
tsset week

quietly eststo: poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report misery_index intl_conference    nati_conference   ww2_memo   icb 
quietly eststo: poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report lstock_pr   intl_conference    nati_conference   ww2_memo  icb 
quietly eststo: poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report gdpgr_yr   intl_conference    nati_conference   ww2_memo  icb 

quietly eststo: poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report misery_index intl_conference    nati_conference   ww2_memo   icb 
quietly eststo: poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report lstock_pr   intl_conference    nati_conference   ww2_memo  icb 
quietly eststo: poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report gdpgr_yr   intl_conference    nati_conference   ww2_memo  icb 

quietly eststo: poisson all_report l.all_report l2.all_report   l4.all_report  misery_index intl_conference    nati_conference   ww2_memo   icb 
quietly eststo: poisson all_report l.all_report l2.all_report   l4.all_report  lstock_pr   intl_conference    nati_conference   ww2_memo  icb 
quietly eststo: poisson all_report l.all_report l2.all_report   l4.all_report  gdpgr_yr   intl_conference    nati_conference   ww2_memo  icb 

esttab using appendix_i.rtf, replace mtitle ( "poisson_nontrd_" "poisson_nontrd" "poisson_nontrd" "poisson_conflict" "poisson_conflict" "poisson_conflict" "poisson_all" "poisson_all" "poisson_all") starlevels( * 0.10 ** 0.05 *** 0.010)
restore



*************************************************************Appendix J**************************************************************************


preserve
eststo clear
tsset week

quietly eststo: poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report c.major##c.gdpgr_yr intl_conference    nati_conference   ww2_memo  lstock_pr  icb misery_index
quietly eststo: poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report c.protest2##c.gdpgr_yr intl_conference    nati_conference   ww2_memo  lstock_pr  misery_index
quietly eststo: poisson nontrd_report l.nontrd_report l2.nontrd_report    l4.nontrd_report c.GDELT_protest##c.gdpgr_yr intl_conference    nati_conference   ww2_memo  lstock_pr   misery_index

quietly eststo: poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report c.major##c.gdpgr_yr intl_conference   nati_conference    ww2_memo  lstock_pr    icb misery_index
quietly eststo: poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report c.protest2##c.gdpgr_yr intl_conference   nati_conference    ww2_memo  lstock_pr   misery_index
quietly eststo: poisson cflct_report l.cflct_report l2.cflct_report  l4.cflct_report c.GDELT_protest##c.gdpgr_yr intl_conference   nati_conference    ww2_memo  lstock_pr  misery_index

quietly eststo:poisson all_report l.all_report l2.all_report   l4.all_report c.major##c.gdpgr_yr  intl_conference nati_conference    ww2_memo lstock_pr  icb misery_index
quietly eststo:poisson all_report l.all_report l2.all_report   l4.all_report c.protest2##c.gdpgr_yr  intl_conference nati_conference    ww2_memo lstock_pr  icb misery_index
quietly eststo:poisson all_report l.all_report l2.all_report   l4.all_report c.GDELT_protest##c.gdpgr_yr  intl_conference nati_conference    ww2_memo lstock_pr misery_index

esttab using appendix_j.rtf, replace mtitle ( "poisson_nontrd_" "nbreg_poisson_nontrd" "poisson_conflict" "nbreg_conflict" "poisson_all" "nbreg_all") starlevels( * 0.10 ** 0.05 *** 0.010)
restore





